home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / mtgdi / threads.h < prev   
Encoding:
C/C++ Source or Header  |  1999-02-19  |  4.0 KB  |  185 lines

  1. // threads.h : declarations for each GDI thread class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #ifndef __THREADS_H__
  14. #define __THREADS_H__
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CGDIThread thread
  18.  
  19. class CGDIThread : public CWinThread
  20. {
  21. public:
  22.     DECLARE_DYNAMIC(CGDIThread)
  23.     CGDIThread(CWnd* pWnd, HDC hDC);
  24.  
  25. // Attributes
  26. public:
  27.     CRect m_rectBorder;
  28.     HDC m_hDC;
  29.     CDC m_dc;
  30.     HANDLE m_hEventKill;
  31.     HANDLE m_hEventDead;
  32.     static HANDLE m_hAnotherDead;
  33.  
  34.     static CRITICAL_SECTION m_csGDILock;
  35.  
  36.     static CCriticalSection m_oCriticalSection;
  37.  
  38. // Operations
  39. public:
  40.     void KillThread();
  41.     void UpdateBorder();
  42.     virtual void SingleStep() = 0;
  43.  
  44. // Overrides
  45.     // ClassWizard generated virtual function overrides
  46.     //{{AFX_VIRTUAL(CGDIThread)
  47.     //}}AFX_VIRTUAL
  48.  
  49. // Implementation
  50. public:
  51.     virtual ~CGDIThread();
  52.     virtual void Delete();
  53.  
  54. protected:
  55.     virtual BOOL InitInstance();
  56.  
  57.     // Generated message map functions
  58.     //{{AFX_MSG(CGDIThread)
  59.         // NOTE - the ClassWizard will add and remove member functions here.
  60.     //}}AFX_MSG
  61.  
  62.     DECLARE_MESSAGE_MAP()
  63. };
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // CBallThread thread
  67.  
  68. class CBallThread : public CGDIThread
  69. {
  70. public:
  71.     DECLARE_DYNAMIC(CBallThread)
  72.     CBallThread(CWnd* pWnd, HDC hDC, 
  73.         CPoint ptPos, CPoint ptVel, CSize Size, COLORREF color);
  74.  
  75. // Attributes
  76. public:
  77.     CRect m_rectPosition;
  78.     CPoint m_ptVelocity;
  79.     HBRUSH m_hBrush;
  80.     CBrush m_brush;
  81.  
  82. // Operations
  83. public:
  84.     virtual BOOL InitInstance();
  85.     virtual void SingleStep();
  86.  
  87. // Overrides
  88.     // ClassWizard generated virtual function overrides
  89.     //{{AFX_VIRTUAL(CBallThread)
  90.     //}}AFX_VIRTUAL
  91.  
  92. // Implementation
  93. protected:
  94.     virtual ~CBallThread() {};
  95.  
  96.     // Generated message map functions
  97.     //{{AFX_MSG(CBallThread)
  98.         // NOTE - the ClassWizard will add and remove member functions here.
  99.     //}}AFX_MSG
  100.  
  101.     DECLARE_MESSAGE_MAP()
  102. };
  103.  
  104. /////////////////////////////////////////////////////////////////////////////
  105. // CRectThread thread
  106.  
  107. class CRectThread : public CGDIThread
  108. {
  109. public:
  110.     DECLARE_DYNAMIC(CRectThread)
  111.     CRectThread(CWnd* pWnd, HDC hDC, 
  112.         CPoint ptPos, CPoint ptVel, CSize Size, COLORREF color);
  113.  
  114. // Attributes
  115. public:
  116.     CRect m_rectPosition;
  117.     CPoint m_ptVelocity;
  118.     HBRUSH m_hBrush;
  119.     CBrush m_brush;
  120.  
  121. // Operations
  122. public:
  123.     virtual BOOL InitInstance();
  124.     virtual void SingleStep();
  125.  
  126. // Overrides
  127.     // ClassWizard generated virtual function overrides
  128.     //{{AFX_VIRTUAL(CRectThread)
  129.     //}}AFX_VIRTUAL
  130.  
  131. // Implementation
  132. protected:
  133.     virtual ~CRectThread() {};
  134.  
  135.     // Generated message map functions
  136.     //{{AFX_MSG(CRectThread)
  137.         // NOTE - the ClassWizard will add and remove member functions here.
  138.     //}}AFX_MSG
  139.  
  140.     DECLARE_MESSAGE_MAP()
  141. };
  142.  
  143. /////////////////////////////////////////////////////////////////////////////
  144. // CLineThread thread
  145.  
  146. class CLineThread : public CGDIThread
  147. {
  148. public:
  149.     DECLARE_DYNAMIC(CLineThread)
  150.     CLineThread(CWnd* pWnd, HDC hDC, 
  151.         CPoint ptPos1, CPoint ptVel1, CPoint ptVel2, CSize Size, COLORREF color);
  152.  
  153. // Attributes
  154. public:
  155.     CPoint m_ptPosition1;
  156.     CPoint m_ptPosition2;
  157.     CPoint m_ptVelocity1;
  158.     CPoint m_ptVelocity2;
  159.     HPEN m_hPen;
  160.     CPen m_pen;
  161.  
  162. // Operations
  163. public:
  164.     virtual BOOL InitInstance();
  165.     virtual void SingleStep();
  166.  
  167. // Overrides
  168.     // ClassWizard generated virtual function overrides
  169.     //{{AFX_VIRTUAL(CLineThread)
  170.     //}}AFX_VIRTUAL
  171.  
  172. // Implementation
  173. protected:
  174.     virtual ~CLineThread() {};
  175.  
  176.     // Generated message map functions
  177.     //{{AFX_MSG(CLineThread)
  178.         // NOTE - the ClassWizard will add and remove member functions here.
  179.     //}}AFX_MSG
  180.  
  181.     DECLARE_MESSAGE_MAP()
  182. };
  183.  
  184. #endif // __THREADS_H__
  185.